package com.school.appleforgetbackend.service;

import com.alibaba.fastjson.JSON;
import com.school.appleforgetbackend.BO.request.CarRequest;
import com.school.appleforgetbackend.BO.response.PreciseQueryResponse;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@Service
@ConditionalOnProperty(prefix = "mock.service", name = "user", havingValue = "false")
public class RealCarService implements CarService {

//    // TODO 请联系羽山科技员工提供相关的账号信息
//    public static String ACCOUNT_ID = "YSSJ204816024";
//    public static String HEX_AES_128_PASSWORD = "5852564658556c4e42566c7059565646";
//    public static String TEST_URI = "http://122.152.195.249:21000/credit-gw/service";
//
//    @Override
//    public PreciseQueryResponse getSelectCar(CarRequest carRequest) {
//        String req_sn1 = UUID.randomUUID().toString().replace("-", "");
//        System.out.println("request_sn:"+req_sn1);
//
//
//        try {
//            String jsonString = JSON.toJSONString(PreciseQueryResponse);
//            String base64String = YushanAES.encode(jsonString, HEX_AES_128_PASSWORD);
//            String response = HttpUtils.HttpSend(base64String,TEST_URI,ACCOUNT_ID,HEX_AES_128_PASSWORD);
//            System.out.println("response:"+response);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
}
